package com.leyou.item.mapper;

import com.leyou.common.mapper.BaseMapper;
import com.leyou.item.entity.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BrandMapper extends BaseMapper<Brand> {

    public void insertCategoryAndBrand(@Param("bid") Long id, @Param("cids") List<Long> cids);

    @Select("SELECT * FROM tb_brand b, tb_category_brand cb " +
            "WHERE b.id = cb.brand_id " +
            "AND cb.category_id = #{id}")
    public List<Brand> findBrandsByCid(Long id);
}
